﻿<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title></title>

    <link href="assets/css/Icons.css" rel="stylesheet">
    <link rel="stylesheet" href="assets/materialize/css/materialize.min.css" media="screen,projection" />
    <!-- Bootstrap Styles-->
    <link href="assets/css/bootstrap.css" rel="stylesheet" />
    <!-- FontAwesome Styles-->
    <link href="assets/css/font-awesome.css" rel="stylesheet" />
    <!-- Morris Chart Styles-->
    <link href="assets/js/morris/morris-0.4.3.min.css" rel="stylesheet" />
    <!-- Custom Styles-->
    <link href="assets/css/custom-styles.css" rel="stylesheet" />
    <!-- Google Fonts-->
    <link href='assets/css/Sans.css' rel='stylesheet' type='text/css' />
    <link rel="stylesheet" href="assets/js/Lightweight-Chart/cssCharts.css">
    <link rel="stylesheet" href="assets/plugins/element-ui/index.css" />



</head>
<body>
<div id="wrapper">
    <nav class="navbar navbar-default top-navbar" role="navigation">
        <div class="navbar-header">
            <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".sidebar-collapse">
                <span class="sr-only">Toggle navigation</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
            <a class="navbar-brand waves-effect waves-dark" href="index.html"><i class="large material-icons">insert_chart</i> <strong>选课系统</strong></a>

            <div id="sideNav" href=""><i class="material-icons dp48">toc</i></div>
        </div>

        <ul class="nav navbar-top-links navbar-right">
            <!--铃铛，配合logoujs就可以每个页面-->
            <li id="badge" v-show="rolee==1">
                <a class="waves-effect waves-dark" href="message.html" data-activates="dropdown2">
                    <el-badge :value="number" :max="99" class="item" style="margin-right: 20px;">
                        <i class="fa fa-bell fa-fw"></i>
                    </el-badge>
                </a>
            </li>
            <li><a class="dropdown-button waves-effect waves-dark" href="#!" data-activates="dropdown1"><i class="fa fa-user fa-fw"></i> <b id="user-name">John Doe</b> <i class="material-icons right">arrow_drop_down</i></a></li>
        </ul>
    </nav>
    <!-- Dropdown Structure -->
    <ul id="dropdown1" class="dropdown-content">
        <li><a href="user-message.html"><i class="fa fa-user fa-fw"></i> 个人信息</a></li>
        <li id="logout"><a href="#"><i class="fa fa-sign-out fa-fw"></i> 退出</a></li>
    </ul>

    <nav class="navbar-default navbar-side" role="navigation" id="navwapper">
        <div class="sidebar-collapse">
            <ul class="nav" id="main-menu">

                <li>
                    <a class="waves-effect waves-dark" href="index.html"><i class="fa fa-dashboard"></i> 首页</a>
                </li>
                <li v-if="rolee == 2 || rolee == 0">
                    <a href="chart.html" class="waves-effect waves-dark"><i class="fa fa-bar-chart-o"></i> 教师管理</a>
                </li>
                <li v-if="rolee == 2 || rolee == 0">
                    <a href="tab-panel.html" class="waves-effect waves-dark"><i class="fa fa-qrcode"></i> 学生管理</a>
                </li>

                <li v-if="rolee == 2 || rolee == 0">
                    <a href="table.html" class="active-menu waves-effect waves-dark"><i class="fa fa-table"></i> 课程管理</a>
                </li>
                <li v-if="rolee == 1">
                    <a href="empty.html" class="waves-effect waves-dark"><i class="fa fa-fw fa-file"></i>学生选课</a>
                </li>
            </ul>

        </div>

    </nav>
    <!-- /. NAV SIDE  -->
    <div id="page-wrapper" >
        <div class="header">
            <h1 class="page-header">
                课程管理
            </h1>
            <ol class="breadcrumb">
                <li><a href="#">Home</a></li>
                <li><a href="#">Tables</a></li>
                <li class="active">Data</li>
            </ol>

        </div>

        <div id="page-inner">

            <div class="row">
                <div class="col-md-12">
                    <div class="card">
                        <div class="card-content">

                            <div>
                                <label style="margin-left: 40px;margin-right: 100px;margin-bottom: 30px">课程编号：<input id="courseId" type="text" class="validate"></label>
                                <label>课程名称：<input id="courseName" type="text" class="validate"></label>
                                <button id="courseSearch" type="button" class="btn btn-warning" style="margin-left: 40px;">搜索</button>
                                <button @click="toAdd()" type="button" class="btn btn-warning" style="margin-left: 280px;">添加</button>
                            </div>
                            <div class="table-responsive">
                                <table style="text-align: center;" class="table table-striped table-bordered table-hover" id="dataTables-example" >
                                    <thead>
                                    <tr>
                                        <th>课程编号</th>
                                        <th>课程名称</th>
                                        <th>课程开始至结束时间</th>
                                        <th>选修课程人数</th>
                                        <th>最大选修人数</th>
                                        <th>课程学分</th>
                                        <th>主讲老师</th>
                                        <th>任课老师</th>
                                        <th v-if="rolee == 2">课程状态</th>
                                        <th v-if="rolee == 2">操作</th>
                                    </tr>
                                    </thead>
                                    <tbody id="tbody">
                                    <tr class="odd gradeX" v-for="(item,index) in list">
                                    <td class='cId'>{{item.courseId}}</td>
                                    <td>{{item.courseName}}</td>
                                    <td>{{item.time}}</td>
                                    <td class="center">{{item.number}}</td>
                                    <td class="center">{{item.maxNumber}}</td>
                                    <td class="center">{{item.credits}}</td>
                                    <td class="center">{{item.mainTeacherName}}</td>
                                        <td class="center" v-if="item.teacherList.length>0">
                                            <span v-for="(item,index) in item.teacherList">{{item.teacherName}} </span>
                                        </td>
                                        <td v-else class="center">
                                            暂时未安排任课老师!
                                        </td>
                                    <td class="center"  v-if="rolee == 2">
                                        <button v-if="item.status == 1" @click="updateStatus(item,0)" type="button" class="btn btn-success">启用</button>
                                        <button v-else @click="updateStatus(item,1)" type="button" class="btn btn-danger">禁用</button>
                                    </td>
                                    <td class="center" v-if="rolee == 2">
                                            <button type="button" @click="toUpdate(item.courseId)" class="btn btn-info" id="update">修改</button>
                                            <button @click="deleteCourse(item.courseId)"type="button" class="btn btn-danger">删除</button>
                                        </td>
                                    </tr>
                                    </tbody>
                                </table>
                            </div>
                            <div id="tableFooter" style="border:3px;display: flex;">

                                <div style="margin: 0px auto;">
                                    <a href="#" id="homePage" style="text-decoration: none;">首页</a>
                                    <a href="#" id="prev" style="text-decoration: none;">&nbsp;<&nbsp; </a>
                                    <span id="current"> &nbsp;1&nbsp; </span>
                                    <a href="#" id="next" style="text-decoration: none;"> &nbsp;>&nbsp; </a>
                                    <a href="#" id="backPage" style="text-decoration: none;margin-right: 50px">尾页</a>
                                    <span>总共<span id="lastPage"></span>页</span>
                                </div>

                                <div style="width: 200px;">
                                    跳转至&nbsp;&nbsp;<input type="text" name="page" id="page" style="width: 30px;">&nbsp;&nbsp;页
                                    <button type="button" class="btn btn-warning" @click="jump()" >跳转</button>
                                </div>
                            </div>

                        </div>
                    </div>
                </div>
            </div>


        </div>
    </div>



</div>
<script src="assets/js/jquery-1.10.2.js"></script>

<script src="assets/js/bootstrap.min.js"></script>

<script src="assets/materialize/js/materialize.min.js"></script>

<script src="assets/js/jquery.metisMenu.js"></script>
<script src="assets/js/morris/raphael-2.1.0.min.js"></script>
<script src="assets/js/morris/morris.js"></script>


<script src="assets/js/easypiechart.js"></script>
<script src="assets/js/easypiechart-data.js"></script>

<script src="assets/js/Lightweight-Chart/jquery.chart.js"></script>

<script src="assets/js/vue.js"></script>
<script src="assets/plugins/element-ui/index.js"></script>
<script src="assets/js/table.js"></script>
<script src="assets/js/logout.js"></script>

</body>
</html>
